time=raw_input()
hour_min=time.split(':')

print "minutes=%d" % (int(hour_min[0])*60+int(hour_min[1]))


